From: Jonas Dreßler Date: Sun, 10 Apr 2022 22:32:06 +0000 (+0200) Subject: Leave cancelling conflicting gestures to Clutters machinery X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~104^2^2~33 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=df2db922172f564b9cef9f1648f7d51fc6415e8d;p=gnome-shell.git Leave cancelling conflicting gestures to Clutters machinery Since everything is a gesture now in the appDisplay, ClutterGesture will do all the cancelling of other gesture by itself now, we merely have to describe the relationship between them. Part-of: --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index e09c97d6f..b4738481b 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -705,11 +705,6 @@ var BaseAppView = GObject.registerClass({ if (monitor !== Main.layoutManager.primaryIndex) return; - if (this._dragFocus) { - this._dragFocus.cancelActions(); - this._dragFocus = null; - } - const adjustment = this._adjustment; adjustment.remove_transition('value'); @@ -932,8 +927,6 @@ var BaseAppView = GObject.registerClass({ }; DND.addDragMonitor(this._dragMonitor); this._appGridLayout.showPageIndicators(); - this._dragFocus = null; - this._swipeTracker.enabled = false; } _onDragMotion(dragEvent) { @@ -981,7 +974,6 @@ var BaseAppView = GObject.registerClass({ this._resetDragPageSwitch(); this._appGridLayout.hidePageIndicators(); - this._swipeTracker.enabled = true; } _onDragCancelled() { @@ -989,7 +981,6 @@ var BaseAppView = GObject.registerClass({ // will move all items to their original positions this._redisplay(); this._appGridLayout.hidePageIndicators(); - this._swipeTracker.enabled = true; } _canAccept(source) { @@ -1259,10 +1250,6 @@ var BaseAppView = GObject.registerClass({ this._appGridLayout.goToPage(pageNumber, animate); this._grid.goToPage(pageNumber, animate); } - - updateDragFocus(dragFocus) { - this._dragFocus = dragFocus; - } }); const PageManager = GObject.registerClass({ @@ -1454,10 +1441,6 @@ class AppDisplay extends BaseAppView { global.settings.is_writable('app-picker-layout'); this._placeholder = new AppIcon(app, {isDraggable}); - this._placeholder.connect('notify::pressed', icon => { - if (icon.pressed) - this.updateDragFocus(icon); - }); this._placeholder.scaleAndFade(); this._redisplay(); } @@ -1533,10 +1516,6 @@ class AppDisplay extends BaseAppView { this._redisplay(); this._savePages(); }); - icon.connect('notify::pressed', () => { - if (icon.pressed) - this.updateDragFocus(icon); - }); } // Don't try to display empty folders @@ -1570,10 +1549,6 @@ class AppDisplay extends BaseAppView { let app = appSys.lookup_app(appId); icon = new AppIcon(app, {isDraggable}); - icon.connect('notify::pressed', () => { - if (icon.pressed) - this.updateDragFocus(icon); - }); } appIcons.push(icon); @@ -2063,12 +2038,6 @@ class AppViewItem extends St.Button { return true; } - cancelActions() { - if (this._draggable) - this._draggable.fakeRelease(); - this.fake_release(); - } - get id() { return this._id; } @@ -3007,12 +2976,6 @@ export const AppIcon = GObject.registerClass({ } } - _onDragBegin() { - if (this._menu) - this._menu.close(true); - super._onDragBegin(); - } - _createIcon(iconSize) { return this.app.create_icon_texture(iconSize); } @@ -3044,7 +3007,6 @@ export const AppIcon = GObject.registerClass({ popupMenu() { this.setForcedHighlight(true); - this.fake_release(); if (!this._menu) { this._menu = new AppMenu(this, this._popupMenuSide, { @@ -3180,12 +3142,6 @@ export const AppIcon = GObject.registerClass({ return view?.createFolder(apps); } - - cancelActions() { - if (this._menu) - this._menu.close(true); - super.cancelActions(); - } }); const SystemActionIcon = GObject.registerClass( diff --git a/js/ui/dnd.js b/js/ui/dnd.js index e90b69ab1..248ebfa53 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -134,16 +134,6 @@ class _Draggable extends Signals.EventEmitter { this._grabbedEventSequence = null; } - /** - * Fake a release event. - * Must be called if you want to intercept release events on draggable - * actors for other purposes (for example if you're using - * PopupMenu.ignoreRelease()) - */ - fakeRelease() { - this._dndGesture.set_state(Clutter.GestureState.CANCELLED); - } - _gestureRecognized() { const pointBeginEvent = this._dndGesture.get_point_begin_event(); [this._dragStartX, this._dragStartY] = pointBeginEvent.get_coords();